class LabDef implements RtlInsn {

    private static int labelCounter = 0;
    private static int returnLabelCounter = 0;

    private int labelNumber;
    private boolean isReturnLabel = false;
    //private String label;
    

    /*    public LabDef (String _label){
	label =_label;
    }
    */

    /*
    private LabDef (int n)
    {
	labelNumber = n;
    }
    */

    public LabDef()
    {
	labelNumber = labelCounter++;
    }
    
    
    public LabDef(boolean returnLabel)
    {
	if(returnLabel)
	{
	    isReturnLabel = true;
	    labelNumber = returnLabelCounter++;
	}
	else
	{
	    labelNumber = labelCounter++;
	}
    }

    public boolean isReturnLabel()
    {
	return isReturnLabel;
    }

    public String getLabel (){
	if(!isReturnLabel)
	    return "L" + Integer.toString(labelNumber);
	else
	    return "R" + Integer.toString(labelNumber);
    }

    /*
    public void setLabel (String _label){
	label =_label;
    }
    */

    public String toString(){
	if(!isReturnLabel)
	    return "labdef" + "(" + "L" + Integer.toString(labelNumber) + ")";
	else
	    return "labdef" + "(" + "R" + Integer.toString(labelNumber) + ")";
    }

    public RtlInstrId getRtlId()
    {
	return RtlInstrId.LABDEF;
    }


}
